'''
@Author: your name
@Date: 2020-03-02 10:09:05
@LastEditTime: 2020-03-03 11:04:46
@LastEditors: Please set LastEditors
@Description: In User Settings Edit
@FilePath: /permcomp/permcomp/settings/develop.py
'''
import os
import logging
import django

from .base import * # NOQA


DEBUG = True


DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}


LOGGING_DIR = os.path.join(BASE_DIR, "logs")
if not os.path.exists(LOGGING_DIR):
    os.mkdir(LOGGING_DIR)


LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'standard': {
            'format': '[%(levelname)s][%(asctime)s][%(filename)s][%(funcName)s][%(lineno)d] > %(message)s'
        },
        'simple': {
            'format': '[%(levelname)s]> %(message)s'
        },
    },
    'handlers': {
        'console': {
            'level': 'INFO',
            'class': 'logging.StreamHandler',
            'formatter': 'simple'
        },
        'file_handler': {
            'level': 'INFO',
            'class': 'logging.handlers.TimedRotatingFileHandler',
            'filename': '%s/permcomp.log' % LOGGING_DIR,
            'formatter':'standard'
        }
    },
    'loggers': {
        'comparison': {
            'handlers': ['console','file_handler'],
            'level':'INFO',  
            'propagate': True,
        }
    }
}


